<?php
   $hide=$_REQUEST["hide"]; 
	$conn=mysqli_connect("127.0.0.1","root","","uniqlo");
	mysqli_query($conn,"SET NAMES utf8");
	if($hide==0){
		$sql="SELECT * FROM user";
		$rs=mysqli_query($conn,$sql);
		$arr=[];
		while(($row=mysqli_fetch_assoc($rs))!=null){
			array_push($arr,$row["name"]);
		}
		echo  $_GET["zpc"]."(".JSON_encode($arr).")";
	}else if($hide==1){
		$user=$_REQUEST["user"];
		$pwd=$_REQUEST["pwd"];
		$email=$_REQUEST["email"];
		$sql="INSERT INTO user VALUES(0,'$user','$pwd','$email')";
		$result=mysqli_query($conn,$sql);
	}else if($hide==2){
		$user=$_REQUEST["user"];
		$pwd=$_REQUEST["pwd"];
		$sql="SELECT name,pwd FROM user";
		$rs=mysqli_query($conn,$sql);
		while(($row=mysqli_fetch_assoc($rs))!=null){
			if($row["name"]==$user && $row["pwd"]==$pwd){
				// echo "<script>location='./status.html';</script>";
				echo "1";
				return false;
			}
		}
		echo "登陆失败";
	}
?>